package xyz.zdsoft.homework_manage_module.Controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xyz.zdsoft.common.utils.Result;
import xyz.zdsoft.homework_manage_module.Service.StudentTaskService;
import xyz.zdsoft.homework_manage_module.bo.StudentJob;
import xyz.zdsoft.homework_manage_module.vo.RestPerTask;
import xyz.zdsoft.homework_manage_module.vo.RestStudentJob;

@Api(tags = "学生作业管理")
@RestController
@RequestMapping("/student/Operation")
public class StudentTaskController {

    @Autowired
    StudentTaskService service;

    @ApiOperation("作业管理")
    @PostMapping("/jobManagement")
    public Result<RestStudentJob> jobManagement(@RequestBody StudentJob studentJob){

        return service.jobManagement(studentJob);
    }
    @ApiOperation("作业任务")
    @PostMapping("/StudentTask/{id}")
    public Result<RestPerTask> StudentTask(@PathVariable Integer id){
        return service.StudentTask(id);
    }
    @ApiOperation("老师批复查看批复情况")
    @PostMapping("/StudentViewApproval/{id}")
    public Result StudentViewApproval(@PathVariable Integer id){
        return service.StudentViewApproval(id);
    }
    @ApiOperation("提交学生答题")
    @PostMapping("/StudentAnswers")
    public Result StudentAnswers(Integer id,String answerRemark ){
      return service.StudentAnswers(id,answerRemark);
    }
    @ApiOperation("保存草稿")
    @PostMapping("/SaveDraft")
    public Result SaveDraft(Integer id,String answerRemark){
        return service.SaveDraft(id,answerRemark);
    }
    @ApiOperation("学生答题")
    @PostMapping("/ViewAnswers/{id}")
    public Result ViewAnswers(@PathVariable Integer id){
        return service.ViewAnswers(id);
    }
}
